The present invention relates to the field of computer graphics. Many computer graphic images are created by mathematically modeling the interaction of light with a three dimensional scene from a given viewpoint. This process, called rendering, generates a two-dimensional image of the scene from the given viewpoint, and is analogous to taking a photograph of a real-world scene. A great deal of effort has been devoted to generating realistic and artistically compelling computer graphics images and animation.
Shadows are among the most important psychophysical clues for judging the relative size, positions, and shapes of objects. Shadows also enhance the mood and visual impact of scenes.
There are numerous algorithms and rendering techniques for generating shadows in computer graphics images. Ray tracing and global illumination rendering algorithms can create images with realistic looking shadows. However, these two rendering algorithms are computationally expensive and typically cannot be used for real-time rendering applications.
Real-time rendering algorithms, such as rasterization algorithms, are commonly used to create computer graphics images at interactive frame rates. Real-time rendering algorithms can be implemented in software executed by a general purpose central processing unit (CPU) and optionally a graphics processing subsystem (GPU), which includes hardware specifically adapted to create computer graphics images by performing operations such as geometry tessellation; transformation; clipping; rasterization; lighting, shading, and texture mapping operations; occlusion and z-buffer evaluation; and/or blending and compositing operations.
Real-time rendering algorithms can apply shadow volume and/or shadow mapping techniques to create shadows. Typical shadow volume and shadow mapping techniques tend to produce shadows with abrupt, sharply defined boundaries between the lit and shadowed areas. However, real-world light sources typically produce shadows with soft or partially shadowed boundaries between the lit and shadowed areas, referred to soft shadows. As a result, the shadows generated by typical real-time rendering algorithms look harsh and unrealistic.
Some improved real-time shadow algorithms use image filters, multiple samples of rendering data, and/or multiple rendering passes to generate soft shadows. However, these techniques are time-consuming, low quality, and/or require extensive pre-processing, making them unacceptable for real-time rendering of dynamic scenes. Moreover, these algorithms cannot correctly render shadows cast by translucent objects or colored shadows, which can be introduced by colored light sources.
It is therefore desirable for a system and method to efficiently create realistic looking soft shadows in computer graphics images that are suitable for use with real-time rendering algorithms. It is further desirable for the system and method to generate soft shadows without the need for pre-processing, making it suitable for use with dynamic scenes. It is also desirable for the system and method to be capable of generating soft shadows for translucent objects and colored shadows. It is still further desirable for the system and method to be readily adaptable for efficient implementation in conventional computers systems and/or graphics processing subsystems, as well as multithreaded, multiprocessor, and/or multiple core parallel processing systems.